package com.eckey.lab.enums;

/**
 * @Author: Marinc
 * @CreateTime: 2024-06-17  14:14
 * @Description: TODO
 * @Version: 1.0
 */
public enum ExceptionEnum {

    // 数据操作错误定义
    SUCCESS("2000", "成功!"),
    CODE_8001("8001", "Service unavailable"),
    CODE_8002("8002", "JSON exception"),
    CODE_8003("8003", "Parameter is invalid"),
    CODE_8004("8004", "Db error"),
    CODE_8005("8005", "{0}参数不能为空"),


    BODY_NOT_MATCH("4000", "请求的数据格式异常：{0}"),
    SIGNATURE_NOT_MATCH("4001", "请求的数字签名不匹配：{0}"),
    NOT_FOUND("4004", "未找到该资源：{0}"),
    INTERNAL_SERVER_ERROR("5000", "服务器内部错误：{0}"),
    SERVER_BUSY("5003", "服务器正忙，请稍后再试：{0}");


    private final String errorCode;
    private final String errorMsg;

    ExceptionEnum(String errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getCode() {
        return this.errorCode;
    }

    public String getErrorMsg() {
        return this.errorMsg;
    }
}
